package com.yc.fresh.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yc.fresh.bean.TypeInfo;
import com.yc.fresh.mapper.ITypeInfoMapper;
import com.yc.fresh.service.ITypeInfoService;
import com.yc.fresh.util.StringUtil;

/**
 * 
 * @author H
 * @date 2021年7月15日
 */
@Service
public class TypeInfoServiceImpl implements ITypeInfoService{
	@Autowired
	private ITypeInfoMapper typeInfoMapper;
	
	@Override
	public int add(TypeInfo type) {
		if(StringUtil.checkNull(type.getTname(),type.getPic())) {
			return -1;
		}
		return typeInfoMapper.add(type);
	}

	@Override
	public List<TypeInfo> findAll() {
		
		return typeInfoMapper.findAll();
	}

	@Override
	public List<TypeInfo> finds() {
		
		return typeInfoMapper.finds();
	}

	@Override
	public int update(TypeInfo tf) {
		// TODO Auto-generated method stub
		return typeInfoMapper.update(tf);
	}

}
